home *** CD-ROM | disk | FTP | other *** search
-
- #include <ezylib.h>
- #include <stdio.h>
- #include <errno.h>
- #include <dos.h>
-
- FILE *hSystemLog;
-
- int OpenSystemLog(char *Filename)
- {
- int Result;
- if ((hSystemLog = fopen(Filename,"at")) != NULL) {
- date d;
- getdate(&d);
- fprintf(hSystemLog,"\n---------- %02d-%s-%d\n",d.da_day,ShortMonths[d.da_mon-1],d.da_year);
- Result = TRUE;
- } else {
- printf("%s opening %s",sys_errlist[errno],Filename);
- Result = FALSE;
- }
- return(Result);
- }
-
- void WriteSystemLog(char *Description)
- {
- if (hSystemLog != NULL) {
- date d;
- time t;
- gettime(&t);
- fprintf(hSystemLog,"> %02d:%02d:%02d %s\n",t.ti_hour,t.ti_min,t.ti_sec,Description);
- }
- }
-
- void CloseSystemLog()
- {
- fclose(hSystemLog);
- }
-